@include('admin.public.head')

<style type="text/css">
    .inner_btn {
        background: #19a97b;
        color: white;
        padding: 5px 8px;
        border-radius: 2px;
    }
</style>

<div class="ibox-title">
    <h5>門店管理</h5>
</div>

<div class="ibox-content">
    @if(permission('/store_add', $user['right_list'], $user['get_routes']))
    <div class="row">
        <div class="col-sm-12 clear">
            <div class="" style="margin: 0 10px">
                <a href="/store_add" class="btn btn-w-m btn-primary">新增</a>
            </div>
        </div>
    </div>
    @endif
    <div class="row">
        <div class="col-sm-12 pull-right m-b-xs">
            <form action="">
                <div class="col-sm-1  m-b-xs text-center pull-right">
                    <button type="submit" class="btn btn-sm btn-primary">搜索</button> </span>
                </div>

                <div class="col-sm-2 text-center pull-right">
                    <input type="text" name="sear_value" value="{{$sear_value}}" placeholder="門店名稱" class="input form-control">
                </div>
            </form>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>門店名稱</th>
            <th>門店地址</th>
            <th>所在省</th>
            <th>所在市區</th>
            <th>所在街區</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach ($result as $v)
            <tr>
                <td>{{$v->store_name}}</td>
                <td>{{$v->store_address}}</td>
                <td>{{$v->province}}</td>
                <td>{{$v->city}}</td>
                <td>{{$v->area}}</td>
                <td>
                    @if(permission('/store_edit', $user['right_list'], $user['get_routes']))
                    <div class="btn-group">
                        <a  class="btn btn-primary btn-sm dropdown-toggle" href="/store_edit/{{$v->id}}">編輯
                        </a>&nbsp;&nbsp;
                    </div>
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
        {{ $result->appends(Request::except ('page'))->links() }}
    </table>
    {{ $result->appends(Request::except ('page'))->links() }}
</div>
